MSC4319: Room member events for invite and knock rooms in the /sync response - #4319
Conversation
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
/sync response
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
|
There are implementations for the latest state of the MSC in: |
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
anoadragon453
left a comment
There was a problem hiding this comment.
LGTM other than one small clarification.
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
| Using the full event format might give the wrong idea that this state has been validated by the | ||
| homeserver, which is currently not possible | ||
| (see [this discussion in MSC4311](https://github.com/matrix-org/matrix-spec-proposals/pull/4311#discussion_r2274781824)). |
There was a problem hiding this comment.
This equally applies to the new state with full events as well. The invite membership event is not "validated" (checked to pass auth rules).
Related reading on outliers and out-of-band membership events in the Synapse docs.
There was a problem hiding this comment.
This doesn't say that the event that we place in state was validated though. It just explains why we should avoid as much as possible to provide the full event format.
Maybe this should be clarified in the spec PR for this MSC?
There was a problem hiding this comment.
Using full state event in state has the same drawbacks of using the full state events in invite_room_state.
I'm not seeing the benefit of the complexity around having both state and invite_room_state (which will be hard to understand from a newcomers perspective) when we could just use full events in invite_room_state with some better notes in the spec.
There was a problem hiding this comment.
Yeah, this introduces additional complexity, that doesn't seem that beneficial. It would be much easier and more backwards compatible to simply have those events in the invite_state as before.
There was a problem hiding this comment.
The original concern of this thread regarding validation of events has a long and storied history. The conclusion is validation isn't needed right now because the data remains untrusted by nature. If/when a future MSC includes the full recursive auth chain, then servers can verify the invite.
For the concern of having two fields doing different things: another MSC to deprecate [invite|knock]_state is welcome. This MSC would not be the one to make that change. If that future MSC were to move quickly enough through the process, I'd suggest that the spec PR for this MSC and that future MSC incorporate both changes (potentially delaying this MSC's merge date).
| > The example for the response of `GET /sync` includes the stripped `m.room.member` event although | ||
| > it is not specified. | ||
|
|
||
| ### `m.room.member` event of the `sender` of the invite |
There was a problem hiding this comment.
I feel like this MSC should solely propose this change on its own: Include the m.room.member for the invite/knock event itself AND m.room.member event for the sender of the invite in stripped state.
All of the extra complexity around clients wanting access to event_id, origin_server_ts, or even full state events is a separate topic. I don't believe the complexity around state vs invite_state is a great approach.
There was a problem hiding this comment.
The purpose of this MSC is to specify behavior that has already been implemented for a long time in some homeservers and clients while not being part of the spec.
It turns out that the current implementations rely on an undesirable API (like mixing event formats) so the extra complexity is needed to have a more consistent API at the cost of requiring changes in implementations.
I don't believe that wanting to access the extra fields is a separate topic because it is all about clients having enough data to present/handle invites and knocks. Without the extra fields, the m.room.member for the invite/knock event itself isn't very useful because it doesn't really provide more data (we can already infer the membership).
There was a problem hiding this comment.
The stripped state version does provide value: The invite is useful to see the invite reason and sender and including the m.room.member of the sender gives you access to the display name/avatar of the person that invited you.
I would consider the current Synapse behavior flawed and including the full state event probably was a simple oversight (element-hq/synapse@ab9cf73).
The only examples of clients that use this extra information are progressive enhancement examples. We can equally instead fix the spec and the Synapse implementation to do the right thing without the clients losing much at all for spec-compliant homeservers. The desire for more info is valid and can be separately advanced in its own MSC that adds the necessary metadata (whatever solution that may be).
There was a problem hiding this comment.
The SCT has previously expressed interest in consistency: either return full state events, or don't. There should not be a mix of formats. The SCT has also expressed that continuing to call it "stripped state" when it contains fully formatted events is wrong. There's also mild opinions around naming it specifically "[invite|knock]_state" when it's the same thing regardless of membership type - it doesn't need to be overly qualified.
These considerations are mentioned somewhere in the depths of #4311, alongside other arguments not relevant to this proposal.
Whether the information is valuable or not is somewhat irrelevant - the format should be consistent, and getting the information needed from an m.room.member event means it's best formatted as a real event. Therefore, all previously-stripped state events should be formatted as real events too.
There was a problem hiding this comment.
It is valuable to confirm that this half-baked state that this MSC ships is not great.
I still think this MSC should have simply defined the extra m.room.member events in stripped state and then another MSC would propose returning full state events for the further use cases.
It sounds like the way forward now that this MSC is merged is to just define that all stripped state events should be presented as full state events in state. Based on #4319 (comment), perhaps even deprecating invite_state/knock_state
There was a problem hiding this comment.
That would be my preferred direction, as an individual.
Introducing m.room.member as stripped state provides none of the useful information to clients while the full event does. We are currently opposed to mixing formats within the same structure, so a new field is required.
There was a problem hiding this comment.
Introducing
m.room.memberas stripped state provides none of the useful information to clients
(it does, see "The stripped state version does provide value:" above)
There are other use cases it doesn't cover but those are the things to be covered by the further MSC.
| For compatibility with the current client implementations, homeservers SHOULD also continue to | ||
| include this event in the `events` array of the `invite_state` or `knock_state` in the same format | ||
| as in `State` for a time limited to 1 spec release after this proposal is released in a new spec | ||
| version. |
There was a problem hiding this comment.
What other clients have relied on the full state of the invite/knock being available?
The only example given so far has been Draupnir wanting event_id.
There was a problem hiding this comment.
In the description of the PR there are a couple of clients accessing the origin_server_ts.
There was a problem hiding this comment.
This seems like much too short of a timeline. I think quite a few clients rely on this event being in the invite_state, even if it is stripped. Removing that after 3 months, when until then clients couldn't rely on it being elsewhere and breaking every client someone might have gotten from a distro repo like Ubuntu, is a bit problematic. But I guess servers will have to support it in both places for longer, if they support an old spec version?
There was a problem hiding this comment.
The version of the spec matters less here. The timeline is probably a bit short, but as a SHOULD there's room for servers to make the best decision for their local ecosystems. Some servers may be able to move faster, some slower - this MSC sets a guideline for what to aim for.
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
|
The final comment period, with a disposition to merge, as per the review above, is now complete. |
Rendered
This was spawned by the discussion in matrix-org/matrix-spec#2181.
Server Implementations:
m.room.memberininvite_state: https://github.com/element-hq/synapse/blob/458e6410e8388fbc6b60b5575850405939bc53eb/synapse/rest/client/sync.py#L450-L462m.room.memberininvite_state: https://github.com/element-hq/synapse/blob/a6e326582f735e03e420c3b86475388fb5f2656c/synapse/handlers/message.py#L1835-L1839m.room.memberinknock_state: https://github.com/element-hq/synapse/blob/458e6410e8388fbc6b60b5575850405939bc53eb/synapse/rest/client/sync.py#L486-L514statekey to invite and knock rooms: Add state key to invite and knock rooms in sync response for MSC4319 element-hq/synapse#19330m.room.memberininvite_state: https://github.com/element-hq/dendrite/blob/8d2da78744387e55c28bb8925ae0cc70dd3e02e3/syncapi/types/types.go#L530-L574invite_state.knock_state.m.room.memberininvite_state(common to all forks): https://gitlab.com/famedly/conduit/-/blob/ed5b0514f52f848e53785dee5fe8de63780cf092/src/api/server_server.rs#L2160-2172m.room.memberininvite_state(Conduit): https://gitlab.com/famedly/conduit/-/merge_requests/766m.room.memberinknock_state(Conduit): https://gitlab.com/famedly/conduit/-/blob/ed5b0514f52f848e53785dee5fe8de63780cf092/src/api/server_server.rs#L2160-2172Most clients already rely on being able to access the
m.room.memberevents of the knock or invite process, and of the inviter.The following client implementations also rely on being able to access the
origin_server_ts:This client implementation supports the new
statekey:SCT Stuff:
MSC checklist
FCP tickyboxes